#ifndef BLUEZAGENT_H
#define BLUEZAGENT_H
#include <KF5/BluezQt/bluezqt/agent.h>

class BluezAgent: public BluezQt::Agent
{
    Q_OBJECT
public:
    explicit BluezAgent(QObject* parent = nullptr);
    ~BluezAgent();
    QDBusObjectPath objectPath()const override;
    Capability capability() const override;
    /**
    * @brief 设备授权请求处理（关键回调函数）
    * @param
    * @author        tangfulong
    * @date          2025-02-27
    */
    void requestPinCode(BluezQt::DevicePtr device, const BluezQt::Request<QString>& request)override;
    void displayPinCode(BluezQt::DevicePtr device, const QString& pinCode)override;
    void requestPasskey(BluezQt::DevicePtr device, const BluezQt::Request<quint32>& request)override;
    void displayPasskey(BluezQt::DevicePtr device, const QString& passkey, const QString& entered)override;
    void requestAuthorization(BluezQt::DevicePtr device, const BluezQt::Request<>& request)override;
    void requestConfirmation(BluezQt::DevicePtr device, const QString& passkey, const BluezQt::Request<>& request)override;
    void authorizeService(BluezQt::DevicePtr device, const QString& uuid, const BluezQt::Request<>& request)override;
    void cancel()override;
    void release()override;
signals:
    void acceptDevice(const QString& address, bool connected);
private:
    struct BluezAgentPrivate;
    BluezAgentPrivate* d_ptr;
};

#endif // BLUEZAGENT_H
